package edu.imu.question.service.impl;

import edu.imu.question.entity.QuestionnaireType;
import edu.imu.question.mapper.QuestionnaireTemplateTypeMapper;
import edu.imu.question.service.TemplateTypeService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Slf4j
@Service
public class TemplateTypeServiceImpl implements TemplateTypeService {
    private QuestionnaireTemplateTypeMapper templateTypeMapper;

    @Autowired
    public TemplateTypeServiceImpl(QuestionnaireTemplateTypeMapper templateTypeMapper) {
        this.templateTypeMapper = templateTypeMapper;
    }

    @Override
    public QuestionnaireType getById(long id) {
        return templateTypeMapper.find(id);
    }

    @Override
    public List<QuestionnaireType> getAll() {
        return templateTypeMapper.findAll();
    }
}
